package com.gnerv.sylvanas.framework.common.model;

import com.gnerv.sylvanas.framework.common.tools.DateTimeTools;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * @author Gnerv LiGen
 */
@Data
public class BaseEntity implements Serializable {

    /**
     * 自增索引
     */
    private Long id;

    /**
     * 创建时间 0 时区时间戳
     */
    private Long gmtCreate;

    /**
     * 修改时间 0 时区时间戳
     */
    private Long gmtModified;

    public void setGmtCreate() {
        this.gmtCreate = DateTimeTools.currentTimeMillis();
    }

    public void setGmtModified() {
        this.gmtModified = DateTimeTools.currentTimeMillis();
    }
}
